
/**
 * This is a generated class and is not intended for modification.  
 */
package valueObjects
{
import com.adobe.fiber.styles.IStyle;
import com.adobe.fiber.styles.Style;
import com.adobe.fiber.styles.StyleValidator;
import com.adobe.fiber.valueobjects.AbstractEntityMetadata;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import mx.events.ValidationResultEvent;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IModelType;
import mx.events.PropertyChangeEvent;

use namespace model_internal;

[ExcludeClass]
internal class _Phenophases_type1EntityMetadata extends com.adobe.fiber.valueobjects.AbstractEntityMetadata
{
    private static var emptyArray:Array = new Array();

    model_internal static var allProperties:Array = new Array("phenophaseCategory", "phenophaseDefinition", "phenophaseAdditionalDefinition", "phenophaseName", "phenophaseID", "seqNum", "phenophase_id", "phenophase_name", "phenophase_category", "phenophase_definition", "phenophase_additional_definition", "color", "seq_num");
    model_internal static var allAssociationProperties:Array = new Array();
    model_internal static var allRequiredProperties:Array = new Array("phenophaseCategory", "phenophaseDefinition", "phenophaseAdditionalDefinition", "phenophaseName", "phenophaseID", "seqNum", "phenophase_id", "phenophase_name", "phenophase_category", "phenophase_definition", "phenophase_additional_definition", "color", "seq_num");
    model_internal static var allAlwaysAvailableProperties:Array = new Array("phenophaseCategory", "phenophaseDefinition", "phenophaseAdditionalDefinition", "phenophaseName", "phenophaseID", "seqNum", "phenophase_id", "phenophase_name", "phenophase_category", "phenophase_definition", "phenophase_additional_definition", "color", "seq_num");
    model_internal static var guardedProperties:Array = new Array();
    model_internal static var dataProperties:Array = new Array("phenophaseCategory", "phenophaseDefinition", "phenophaseAdditionalDefinition", "phenophaseName", "phenophaseID", "seqNum", "phenophase_id", "phenophase_name", "phenophase_category", "phenophase_definition", "phenophase_additional_definition", "color", "seq_num");
    model_internal static var sourceProperties:Array = emptyArray
    model_internal static var nonDerivedProperties:Array = new Array("phenophaseCategory", "phenophaseDefinition", "phenophaseAdditionalDefinition", "phenophaseName", "phenophaseID", "seqNum", "phenophase_id", "phenophase_name", "phenophase_category", "phenophase_definition", "phenophase_additional_definition", "color", "seq_num");
    model_internal static var derivedProperties:Array = new Array();
    model_internal static var collectionProperties:Array = new Array();
    model_internal static var collectionBaseMap:Object;
    model_internal static var entityName:String = "Phenophases_type1";
    model_internal static var dependentsOnMap:Object;
    model_internal static var dependedOnServices:Array = new Array();
    model_internal static var propertyTypeMap:Object;

    
    model_internal var _phenophaseCategoryIsValid:Boolean;
    model_internal var _phenophaseCategoryValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _phenophaseCategoryIsValidCacheInitialized:Boolean = false;
    model_internal var _phenophaseCategoryValidationFailureMessages:Array;
    
    model_internal var _phenophaseDefinitionIsValid:Boolean;
    model_internal var _phenophaseDefinitionValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _phenophaseDefinitionIsValidCacheInitialized:Boolean = false;
    model_internal var _phenophaseDefinitionValidationFailureMessages:Array;
    
    model_internal var _phenophaseAdditionalDefinitionIsValid:Boolean;
    model_internal var _phenophaseAdditionalDefinitionValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _phenophaseAdditionalDefinitionIsValidCacheInitialized:Boolean = false;
    model_internal var _phenophaseAdditionalDefinitionValidationFailureMessages:Array;
    
    model_internal var _phenophaseNameIsValid:Boolean;
    model_internal var _phenophaseNameValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _phenophaseNameIsValidCacheInitialized:Boolean = false;
    model_internal var _phenophaseNameValidationFailureMessages:Array;
    
    model_internal var _phenophase_nameIsValid:Boolean;
    model_internal var _phenophase_nameValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _phenophase_nameIsValidCacheInitialized:Boolean = false;
    model_internal var _phenophase_nameValidationFailureMessages:Array;
    
    model_internal var _phenophase_categoryIsValid:Boolean;
    model_internal var _phenophase_categoryValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _phenophase_categoryIsValidCacheInitialized:Boolean = false;
    model_internal var _phenophase_categoryValidationFailureMessages:Array;
    
    model_internal var _phenophase_definitionIsValid:Boolean;
    model_internal var _phenophase_definitionValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _phenophase_definitionIsValidCacheInitialized:Boolean = false;
    model_internal var _phenophase_definitionValidationFailureMessages:Array;
    
    model_internal var _phenophase_additional_definitionIsValid:Boolean;
    model_internal var _phenophase_additional_definitionValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _phenophase_additional_definitionIsValidCacheInitialized:Boolean = false;
    model_internal var _phenophase_additional_definitionValidationFailureMessages:Array;
    
    model_internal var _colorIsValid:Boolean;
    model_internal var _colorValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _colorIsValidCacheInitialized:Boolean = false;
    model_internal var _colorValidationFailureMessages:Array;

    model_internal var _instance:_Super_Phenophases_type1;
    model_internal static var _nullStyle:com.adobe.fiber.styles.Style = new com.adobe.fiber.styles.Style();

    public function _Phenophases_type1EntityMetadata(value : _Super_Phenophases_type1)
    {
        // initialize property maps
        if (model_internal::dependentsOnMap == null)
        {
            // dependents map
            model_internal::dependentsOnMap = new Object();
            model_internal::dependentsOnMap["phenophaseCategory"] = new Array();
            model_internal::dependentsOnMap["phenophaseDefinition"] = new Array();
            model_internal::dependentsOnMap["phenophaseAdditionalDefinition"] = new Array();
            model_internal::dependentsOnMap["phenophaseName"] = new Array();
            model_internal::dependentsOnMap["phenophaseID"] = new Array();
            model_internal::dependentsOnMap["seqNum"] = new Array();
            model_internal::dependentsOnMap["phenophase_id"] = new Array();
            model_internal::dependentsOnMap["phenophase_name"] = new Array();
            model_internal::dependentsOnMap["phenophase_category"] = new Array();
            model_internal::dependentsOnMap["phenophase_definition"] = new Array();
            model_internal::dependentsOnMap["phenophase_additional_definition"] = new Array();
            model_internal::dependentsOnMap["color"] = new Array();
            model_internal::dependentsOnMap["seq_num"] = new Array();

            // collection base map
            model_internal::collectionBaseMap = new Object();
        }

        // Property type Map
        model_internal::propertyTypeMap = new Object();
        model_internal::propertyTypeMap["phenophaseCategory"] = "String";
        model_internal::propertyTypeMap["phenophaseDefinition"] = "String";
        model_internal::propertyTypeMap["phenophaseAdditionalDefinition"] = "String";
        model_internal::propertyTypeMap["phenophaseName"] = "String";
        model_internal::propertyTypeMap["phenophaseID"] = "int";
        model_internal::propertyTypeMap["seqNum"] = "int";
        model_internal::propertyTypeMap["phenophase_id"] = "int";
        model_internal::propertyTypeMap["phenophase_name"] = "String";
        model_internal::propertyTypeMap["phenophase_category"] = "String";
        model_internal::propertyTypeMap["phenophase_definition"] = "String";
        model_internal::propertyTypeMap["phenophase_additional_definition"] = "String";
        model_internal::propertyTypeMap["color"] = "String";
        model_internal::propertyTypeMap["seq_num"] = "int";

        model_internal::_instance = value;
        model_internal::_phenophaseCategoryValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForPhenophaseCategory);
        model_internal::_phenophaseCategoryValidator.required = true;
        model_internal::_phenophaseCategoryValidator.requiredFieldError = "phenophaseCategory is required";
        //model_internal::_phenophaseCategoryValidator.source = model_internal::_instance;
        //model_internal::_phenophaseCategoryValidator.property = "phenophaseCategory";
        model_internal::_phenophaseDefinitionValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForPhenophaseDefinition);
        model_internal::_phenophaseDefinitionValidator.required = true;
        model_internal::_phenophaseDefinitionValidator.requiredFieldError = "phenophaseDefinition is required";
        //model_internal::_phenophaseDefinitionValidator.source = model_internal::_instance;
        //model_internal::_phenophaseDefinitionValidator.property = "phenophaseDefinition";
        model_internal::_phenophaseAdditionalDefinitionValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForPhenophaseAdditionalDefinition);
        model_internal::_phenophaseAdditionalDefinitionValidator.required = true;
        model_internal::_phenophaseAdditionalDefinitionValidator.requiredFieldError = "phenophaseAdditionalDefinition is required";
        //model_internal::_phenophaseAdditionalDefinitionValidator.source = model_internal::_instance;
        //model_internal::_phenophaseAdditionalDefinitionValidator.property = "phenophaseAdditionalDefinition";
        model_internal::_phenophaseNameValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForPhenophaseName);
        model_internal::_phenophaseNameValidator.required = true;
        model_internal::_phenophaseNameValidator.requiredFieldError = "phenophaseName is required";
        //model_internal::_phenophaseNameValidator.source = model_internal::_instance;
        //model_internal::_phenophaseNameValidator.property = "phenophaseName";
        model_internal::_phenophase_nameValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForPhenophase_name);
        model_internal::_phenophase_nameValidator.required = true;
        model_internal::_phenophase_nameValidator.requiredFieldError = "phenophase_name is required";
        //model_internal::_phenophase_nameValidator.source = model_internal::_instance;
        //model_internal::_phenophase_nameValidator.property = "phenophase_name";
        model_internal::_phenophase_categoryValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForPhenophase_category);
        model_internal::_phenophase_categoryValidator.required = true;
        model_internal::_phenophase_categoryValidator.requiredFieldError = "phenophase_category is required";
        //model_internal::_phenophase_categoryValidator.source = model_internal::_instance;
        //model_internal::_phenophase_categoryValidator.property = "phenophase_category";
        model_internal::_phenophase_definitionValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForPhenophase_definition);
        model_internal::_phenophase_definitionValidator.required = true;
        model_internal::_phenophase_definitionValidator.requiredFieldError = "phenophase_definition is required";
        //model_internal::_phenophase_definitionValidator.source = model_internal::_instance;
        //model_internal::_phenophase_definitionValidator.property = "phenophase_definition";
        model_internal::_phenophase_additional_definitionValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForPhenophase_additional_definition);
        model_internal::_phenophase_additional_definitionValidator.required = true;
        model_internal::_phenophase_additional_definitionValidator.requiredFieldError = "phenophase_additional_definition is required";
        //model_internal::_phenophase_additional_definitionValidator.source = model_internal::_instance;
        //model_internal::_phenophase_additional_definitionValidator.property = "phenophase_additional_definition";
        model_internal::_colorValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForColor);
        model_internal::_colorValidator.required = true;
        model_internal::_colorValidator.requiredFieldError = "color is required";
        //model_internal::_colorValidator.source = model_internal::_instance;
        //model_internal::_colorValidator.property = "color";
    }

    override public function getEntityName():String
    {
        return model_internal::entityName;
    }

    override public function getProperties():Array
    {
        return model_internal::allProperties;
    }

    override public function getAssociationProperties():Array
    {
        return model_internal::allAssociationProperties;
    }

    override public function getRequiredProperties():Array
    {
         return model_internal::allRequiredProperties;   
    }

    override public function getDataProperties():Array
    {
        return model_internal::dataProperties;
    }

    public function getSourceProperties():Array
    {
        return model_internal::sourceProperties;
    }

    public function getNonDerivedProperties():Array
    {
        return model_internal::nonDerivedProperties;
    }

    override public function getGuardedProperties():Array
    {
        return model_internal::guardedProperties;
    }

    override public function getUnguardedProperties():Array
    {
        return model_internal::allAlwaysAvailableProperties;
    }

    override public function getDependants(propertyName:String):Array
    {
       if (model_internal::nonDerivedProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a data property of entity Phenophases_type1");
            
       return model_internal::dependentsOnMap[propertyName] as Array;  
    }

    override public function getDependedOnServices():Array
    {
        return model_internal::dependedOnServices;
    }

    override public function getCollectionProperties():Array
    {
        return model_internal::collectionProperties;
    }

    override public function getCollectionBase(propertyName:String):String
    {
        if (model_internal::collectionProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a collection property of entity Phenophases_type1");

        return model_internal::collectionBaseMap[propertyName];
    }
    
    override public function getPropertyType(propertyName:String):String
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a property of Phenophases_type1");

        return model_internal::propertyTypeMap[propertyName];
    }

    override public function getAvailableProperties():com.adobe.fiber.valueobjects.IPropertyIterator
    {
        return new com.adobe.fiber.valueobjects.AvailablePropertyIterator(this);
    }

    override public function getValue(propertyName:String):*
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity Phenophases_type1");
        }

        return model_internal::_instance[propertyName];
    }

    override public function setValue(propertyName:String, value:*):void
    {
        if (model_internal::nonDerivedProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " is not a modifiable property of entity Phenophases_type1");
        }

        model_internal::_instance[propertyName] = value;
    }

    override public function getMappedByProperty(associationProperty:String):String
    {
        switch(associationProperty)
        {
            default:
            {
                return null;
            }
        }
    }

    override public function getPropertyLength(propertyName:String):int
    {
        switch(propertyName)
        {
            default:
            {
                return 0;
            }
        }
    }

    override public function isAvailable(propertyName:String):Boolean
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity Phenophases_type1");
        }

        if (model_internal::allAlwaysAvailableProperties.indexOf(propertyName) != -1)
        {
            return true;
        }

        switch(propertyName)
        {
            default:
            {
                return true;
            }
        }
    }

    override public function getIdentityMap():Object
    {
        var returnMap:Object = new Object();

        return returnMap;
    }

    [Bindable(event="propertyChange")]
    override public function get invalidConstraints():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_invalidConstraints;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_invalidConstraints;        
        }
    }

    [Bindable(event="propertyChange")]
    override public function get validationFailureMessages():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
    }

    override public function getDependantInvalidConstraints(propertyName:String):Array
    {
        var dependants:Array = getDependants(propertyName);
        if (dependants.length == 0)
        {
            return emptyArray;
        }

        var currentlyInvalid:Array = invalidConstraints;
        if (currentlyInvalid.length == 0)
        {
            return emptyArray;
        }

        var filterFunc:Function = function(element:*, index:int, arr:Array):Boolean
        {
            return dependants.indexOf(element) > -1;
        }

        return currentlyInvalid.filter(filterFunc);
    }

    /**
     * isValid
     */
    [Bindable(event="propertyChange")] 
    public function get isValid() : Boolean
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_isValid;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_isValid;
        }
    }

    [Bindable(event="propertyChange")]
    public function get isPhenophaseCategoryAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPhenophaseDefinitionAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPhenophaseAdditionalDefinitionAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPhenophaseNameAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPhenophaseIDAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isSeqNumAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPhenophase_idAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPhenophase_nameAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPhenophase_categoryAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPhenophase_definitionAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPhenophase_additional_definitionAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isColorAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isSeq_numAvailable():Boolean
    {
        return true;
    }


    /**
     * derived property recalculation
     */
    public function invalidateDependentOnPhenophaseCategory():void
    {
        if (model_internal::_phenophaseCategoryIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfPhenophaseCategory = null;
            model_internal::calculatePhenophaseCategoryIsValid();
        }
    }
    public function invalidateDependentOnPhenophaseDefinition():void
    {
        if (model_internal::_phenophaseDefinitionIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfPhenophaseDefinition = null;
            model_internal::calculatePhenophaseDefinitionIsValid();
        }
    }
    public function invalidateDependentOnPhenophaseAdditionalDefinition():void
    {
        if (model_internal::_phenophaseAdditionalDefinitionIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfPhenophaseAdditionalDefinition = null;
            model_internal::calculatePhenophaseAdditionalDefinitionIsValid();
        }
    }
    public function invalidateDependentOnPhenophaseName():void
    {
        if (model_internal::_phenophaseNameIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfPhenophaseName = null;
            model_internal::calculatePhenophaseNameIsValid();
        }
    }
    public function invalidateDependentOnPhenophase_name():void
    {
        if (model_internal::_phenophase_nameIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfPhenophase_name = null;
            model_internal::calculatePhenophase_nameIsValid();
        }
    }
    public function invalidateDependentOnPhenophase_category():void
    {
        if (model_internal::_phenophase_categoryIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfPhenophase_category = null;
            model_internal::calculatePhenophase_categoryIsValid();
        }
    }
    public function invalidateDependentOnPhenophase_definition():void
    {
        if (model_internal::_phenophase_definitionIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfPhenophase_definition = null;
            model_internal::calculatePhenophase_definitionIsValid();
        }
    }
    public function invalidateDependentOnPhenophase_additional_definition():void
    {
        if (model_internal::_phenophase_additional_definitionIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfPhenophase_additional_definition = null;
            model_internal::calculatePhenophase_additional_definitionIsValid();
        }
    }
    public function invalidateDependentOnColor():void
    {
        if (model_internal::_colorIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfColor = null;
            model_internal::calculateColorIsValid();
        }
    }

    model_internal function fireChangeEvent(propertyName:String, oldValue:Object, newValue:Object):void
    {
        this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, propertyName, oldValue, newValue));
    }

    [Bindable(event="propertyChange")]   
    public function get phenophaseCategoryStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get phenophaseCategoryValidator() : StyleValidator
    {
        return model_internal::_phenophaseCategoryValidator;
    }

    model_internal function set _phenophaseCategoryIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_phenophaseCategoryIsValid;         
        if (oldValue !== value)
        {
            model_internal::_phenophaseCategoryIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophaseCategoryIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get phenophaseCategoryIsValid():Boolean
    {
        if (!model_internal::_phenophaseCategoryIsValidCacheInitialized)
        {
            model_internal::calculatePhenophaseCategoryIsValid();
        }

        return model_internal::_phenophaseCategoryIsValid;
    }

    model_internal function calculatePhenophaseCategoryIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_phenophaseCategoryValidator.validate(model_internal::_instance.phenophaseCategory)
        model_internal::_phenophaseCategoryIsValid_der = (valRes.results == null);
        model_internal::_phenophaseCategoryIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::phenophaseCategoryValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::phenophaseCategoryValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get phenophaseCategoryValidationFailureMessages():Array
    {
        if (model_internal::_phenophaseCategoryValidationFailureMessages == null)
            model_internal::calculatePhenophaseCategoryIsValid();

        return _phenophaseCategoryValidationFailureMessages;
    }

    model_internal function set phenophaseCategoryValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_phenophaseCategoryValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_phenophaseCategoryValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophaseCategoryValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get phenophaseDefinitionStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get phenophaseDefinitionValidator() : StyleValidator
    {
        return model_internal::_phenophaseDefinitionValidator;
    }

    model_internal function set _phenophaseDefinitionIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_phenophaseDefinitionIsValid;         
        if (oldValue !== value)
        {
            model_internal::_phenophaseDefinitionIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophaseDefinitionIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get phenophaseDefinitionIsValid():Boolean
    {
        if (!model_internal::_phenophaseDefinitionIsValidCacheInitialized)
        {
            model_internal::calculatePhenophaseDefinitionIsValid();
        }

        return model_internal::_phenophaseDefinitionIsValid;
    }

    model_internal function calculatePhenophaseDefinitionIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_phenophaseDefinitionValidator.validate(model_internal::_instance.phenophaseDefinition)
        model_internal::_phenophaseDefinitionIsValid_der = (valRes.results == null);
        model_internal::_phenophaseDefinitionIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::phenophaseDefinitionValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::phenophaseDefinitionValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get phenophaseDefinitionValidationFailureMessages():Array
    {
        if (model_internal::_phenophaseDefinitionValidationFailureMessages == null)
            model_internal::calculatePhenophaseDefinitionIsValid();

        return _phenophaseDefinitionValidationFailureMessages;
    }

    model_internal function set phenophaseDefinitionValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_phenophaseDefinitionValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_phenophaseDefinitionValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophaseDefinitionValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get phenophaseAdditionalDefinitionStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get phenophaseAdditionalDefinitionValidator() : StyleValidator
    {
        return model_internal::_phenophaseAdditionalDefinitionValidator;
    }

    model_internal function set _phenophaseAdditionalDefinitionIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_phenophaseAdditionalDefinitionIsValid;         
        if (oldValue !== value)
        {
            model_internal::_phenophaseAdditionalDefinitionIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophaseAdditionalDefinitionIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get phenophaseAdditionalDefinitionIsValid():Boolean
    {
        if (!model_internal::_phenophaseAdditionalDefinitionIsValidCacheInitialized)
        {
            model_internal::calculatePhenophaseAdditionalDefinitionIsValid();
        }

        return model_internal::_phenophaseAdditionalDefinitionIsValid;
    }

    model_internal function calculatePhenophaseAdditionalDefinitionIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_phenophaseAdditionalDefinitionValidator.validate(model_internal::_instance.phenophaseAdditionalDefinition)
        model_internal::_phenophaseAdditionalDefinitionIsValid_der = (valRes.results == null);
        model_internal::_phenophaseAdditionalDefinitionIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::phenophaseAdditionalDefinitionValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::phenophaseAdditionalDefinitionValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get phenophaseAdditionalDefinitionValidationFailureMessages():Array
    {
        if (model_internal::_phenophaseAdditionalDefinitionValidationFailureMessages == null)
            model_internal::calculatePhenophaseAdditionalDefinitionIsValid();

        return _phenophaseAdditionalDefinitionValidationFailureMessages;
    }

    model_internal function set phenophaseAdditionalDefinitionValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_phenophaseAdditionalDefinitionValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_phenophaseAdditionalDefinitionValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophaseAdditionalDefinitionValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get phenophaseNameStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get phenophaseNameValidator() : StyleValidator
    {
        return model_internal::_phenophaseNameValidator;
    }

    model_internal function set _phenophaseNameIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_phenophaseNameIsValid;         
        if (oldValue !== value)
        {
            model_internal::_phenophaseNameIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophaseNameIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get phenophaseNameIsValid():Boolean
    {
        if (!model_internal::_phenophaseNameIsValidCacheInitialized)
        {
            model_internal::calculatePhenophaseNameIsValid();
        }

        return model_internal::_phenophaseNameIsValid;
    }

    model_internal function calculatePhenophaseNameIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_phenophaseNameValidator.validate(model_internal::_instance.phenophaseName)
        model_internal::_phenophaseNameIsValid_der = (valRes.results == null);
        model_internal::_phenophaseNameIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::phenophaseNameValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::phenophaseNameValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get phenophaseNameValidationFailureMessages():Array
    {
        if (model_internal::_phenophaseNameValidationFailureMessages == null)
            model_internal::calculatePhenophaseNameIsValid();

        return _phenophaseNameValidationFailureMessages;
    }

    model_internal function set phenophaseNameValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_phenophaseNameValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_phenophaseNameValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophaseNameValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get phenophaseIDStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get seqNumStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get phenophase_idStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get phenophase_nameStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get phenophase_nameValidator() : StyleValidator
    {
        return model_internal::_phenophase_nameValidator;
    }

    model_internal function set _phenophase_nameIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_phenophase_nameIsValid;         
        if (oldValue !== value)
        {
            model_internal::_phenophase_nameIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophase_nameIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get phenophase_nameIsValid():Boolean
    {
        if (!model_internal::_phenophase_nameIsValidCacheInitialized)
        {
            model_internal::calculatePhenophase_nameIsValid();
        }

        return model_internal::_phenophase_nameIsValid;
    }

    model_internal function calculatePhenophase_nameIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_phenophase_nameValidator.validate(model_internal::_instance.phenophase_name)
        model_internal::_phenophase_nameIsValid_der = (valRes.results == null);
        model_internal::_phenophase_nameIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::phenophase_nameValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::phenophase_nameValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get phenophase_nameValidationFailureMessages():Array
    {
        if (model_internal::_phenophase_nameValidationFailureMessages == null)
            model_internal::calculatePhenophase_nameIsValid();

        return _phenophase_nameValidationFailureMessages;
    }

    model_internal function set phenophase_nameValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_phenophase_nameValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_phenophase_nameValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophase_nameValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get phenophase_categoryStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get phenophase_categoryValidator() : StyleValidator
    {
        return model_internal::_phenophase_categoryValidator;
    }

    model_internal function set _phenophase_categoryIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_phenophase_categoryIsValid;         
        if (oldValue !== value)
        {
            model_internal::_phenophase_categoryIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophase_categoryIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get phenophase_categoryIsValid():Boolean
    {
        if (!model_internal::_phenophase_categoryIsValidCacheInitialized)
        {
            model_internal::calculatePhenophase_categoryIsValid();
        }

        return model_internal::_phenophase_categoryIsValid;
    }

    model_internal function calculatePhenophase_categoryIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_phenophase_categoryValidator.validate(model_internal::_instance.phenophase_category)
        model_internal::_phenophase_categoryIsValid_der = (valRes.results == null);
        model_internal::_phenophase_categoryIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::phenophase_categoryValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::phenophase_categoryValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get phenophase_categoryValidationFailureMessages():Array
    {
        if (model_internal::_phenophase_categoryValidationFailureMessages == null)
            model_internal::calculatePhenophase_categoryIsValid();

        return _phenophase_categoryValidationFailureMessages;
    }

    model_internal function set phenophase_categoryValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_phenophase_categoryValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_phenophase_categoryValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophase_categoryValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get phenophase_definitionStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get phenophase_definitionValidator() : StyleValidator
    {
        return model_internal::_phenophase_definitionValidator;
    }

    model_internal function set _phenophase_definitionIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_phenophase_definitionIsValid;         
        if (oldValue !== value)
        {
            model_internal::_phenophase_definitionIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophase_definitionIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get phenophase_definitionIsValid():Boolean
    {
        if (!model_internal::_phenophase_definitionIsValidCacheInitialized)
        {
            model_internal::calculatePhenophase_definitionIsValid();
        }

        return model_internal::_phenophase_definitionIsValid;
    }

    model_internal function calculatePhenophase_definitionIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_phenophase_definitionValidator.validate(model_internal::_instance.phenophase_definition)
        model_internal::_phenophase_definitionIsValid_der = (valRes.results == null);
        model_internal::_phenophase_definitionIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::phenophase_definitionValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::phenophase_definitionValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get phenophase_definitionValidationFailureMessages():Array
    {
        if (model_internal::_phenophase_definitionValidationFailureMessages == null)
            model_internal::calculatePhenophase_definitionIsValid();

        return _phenophase_definitionValidationFailureMessages;
    }

    model_internal function set phenophase_definitionValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_phenophase_definitionValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_phenophase_definitionValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophase_definitionValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get phenophase_additional_definitionStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get phenophase_additional_definitionValidator() : StyleValidator
    {
        return model_internal::_phenophase_additional_definitionValidator;
    }

    model_internal function set _phenophase_additional_definitionIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_phenophase_additional_definitionIsValid;         
        if (oldValue !== value)
        {
            model_internal::_phenophase_additional_definitionIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophase_additional_definitionIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get phenophase_additional_definitionIsValid():Boolean
    {
        if (!model_internal::_phenophase_additional_definitionIsValidCacheInitialized)
        {
            model_internal::calculatePhenophase_additional_definitionIsValid();
        }

        return model_internal::_phenophase_additional_definitionIsValid;
    }

    model_internal function calculatePhenophase_additional_definitionIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_phenophase_additional_definitionValidator.validate(model_internal::_instance.phenophase_additional_definition)
        model_internal::_phenophase_additional_definitionIsValid_der = (valRes.results == null);
        model_internal::_phenophase_additional_definitionIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::phenophase_additional_definitionValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::phenophase_additional_definitionValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get phenophase_additional_definitionValidationFailureMessages():Array
    {
        if (model_internal::_phenophase_additional_definitionValidationFailureMessages == null)
            model_internal::calculatePhenophase_additional_definitionIsValid();

        return _phenophase_additional_definitionValidationFailureMessages;
    }

    model_internal function set phenophase_additional_definitionValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_phenophase_additional_definitionValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_phenophase_additional_definitionValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phenophase_additional_definitionValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get colorStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get colorValidator() : StyleValidator
    {
        return model_internal::_colorValidator;
    }

    model_internal function set _colorIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_colorIsValid;         
        if (oldValue !== value)
        {
            model_internal::_colorIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "colorIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get colorIsValid():Boolean
    {
        if (!model_internal::_colorIsValidCacheInitialized)
        {
            model_internal::calculateColorIsValid();
        }

        return model_internal::_colorIsValid;
    }

    model_internal function calculateColorIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_colorValidator.validate(model_internal::_instance.color)
        model_internal::_colorIsValid_der = (valRes.results == null);
        model_internal::_colorIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::colorValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::colorValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get colorValidationFailureMessages():Array
    {
        if (model_internal::_colorValidationFailureMessages == null)
            model_internal::calculateColorIsValid();

        return _colorValidationFailureMessages;
    }

    model_internal function set colorValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_colorValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_colorValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "colorValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get seq_numStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }


     /**
     * 
     * @inheritDoc 
     */ 
     override public function getStyle(propertyName:String):com.adobe.fiber.styles.IStyle
     {
         switch(propertyName)
         {
            default:
            {
                return null;
            }
         }
     }
     
     /**
     * 
     * @inheritDoc 
     *  
     */  
     override public function getPropertyValidationFailureMessages(propertyName:String):Array
     {
         switch(propertyName)
         {
            case("phenophaseCategory"):
            {
                return phenophaseCategoryValidationFailureMessages;
            }
            case("phenophaseDefinition"):
            {
                return phenophaseDefinitionValidationFailureMessages;
            }
            case("phenophaseAdditionalDefinition"):
            {
                return phenophaseAdditionalDefinitionValidationFailureMessages;
            }
            case("phenophaseName"):
            {
                return phenophaseNameValidationFailureMessages;
            }
            case("phenophase_name"):
            {
                return phenophase_nameValidationFailureMessages;
            }
            case("phenophase_category"):
            {
                return phenophase_categoryValidationFailureMessages;
            }
            case("phenophase_definition"):
            {
                return phenophase_definitionValidationFailureMessages;
            }
            case("phenophase_additional_definition"):
            {
                return phenophase_additional_definitionValidationFailureMessages;
            }
            case("color"):
            {
                return colorValidationFailureMessages;
            }
            default:
            {
                return emptyArray;
            }
         }
     }

}

}
